<%@ page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false"
	pageEncoding="UTF-8"%>
<%@ page import="eu.bitwalker.useragentutils.UserAgent" %>
<%@ page import="eu.bitwalker.useragentutils.Browser" %>
<%@ page import="eu.bitwalker.useragentutils.OperatingSystem" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" type="text/css" href="<%=basePath%>jslib/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>jslib/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>jslib/easyui/demo/demo.css">
<script type="text/javascript" src="<%=basePath%>jslib//easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>jslib/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>jslib/easyui/locale/easyui-lang-zh_CN.js"></script>

<title><c:out value="UserAgentUtils测试页面"></c:out></title>
</head>
<body>
<%
//获取浏览器信息
String ua = request.getHeader("User-Agent");
//转成UserAgent对象
UserAgent userAgent = UserAgent.parseUserAgentString(ua); 
//获取浏览器信息
Browser browser = userAgent.getBrowser();  
//获取系统信息
OperatingSystem os = userAgent.getOperatingSystem();
//系统名称
String system = os.getName();
//浏览器名称
String browserName = browser.getName();


%>


UserAgent对象: <%=userAgent %> <br>
浏览器信息: <%=browser %> <br>
系统信息: <%=os %> <br>
系统名称: <%=system %> <br>
浏览器名称: <%=browserName %> <br>
<br>


</body>
</html>